﻿@{
    ViewBag.Title = "生产线数据";
}
<section class="container-fluid m15_t">
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <form class="form-inline" id="formSearch" method="get" action="/DeviceData/ExportExcel">
            <div class="pull-left form-inline ">
                <a class="btn btn-default btn-sm add" data-title="导出" onclick="return exportExcel();"><span class="glyphicon glyphicon-plus"></span> 导出</a>
            </div>
            <div class="pull-right">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">设备区域：</label>
                        @{
                            <select name="deviceLine" class="form-control">
                                <option value="">选择设备区域</option>
                                <option value="20" selected>组合区</option>
                                <option value="10">PP区</option>
                            </select>
                        }
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">状态：</label>
                            @{
                                <select name="status" class="form-control">
                                    <option value="">选择状态</option>
                                    <option value="1">工作</option>
                                    <option value="2">空闲</option>
                                    <option value="3">异常</option>
                                    <option value="4">换料</option>
                                    <option value="5">班保养</option>
                                    <option value="6">周保养</option>
                                    <option value="7">堵满本</option>
                                    <option value="8">待空底板</option>
                                    <option value="9">换钢板</option>
                                    <option value="10">换铜箔</option>
                                    <option value="11">换PP</option>
                                    <option value="12">无板生产</option>
                                    <option value="13">禁止生产</option>
                                    <option value="14">计划停机</option>
                                    <option value="15">设备维修</option>
                                </select>
                            }
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">时间：</label>
                        <input id="d421" class="Wdate wd110" name="startTime" type="text" value="@(ViewBag.StartTime)" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d'})" autocomplete="off" />
                        -
                        <input id="d422" class="Wdate wd110 m5_l" name="endTime" type="text" value="@(ViewBag.EndTime)" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'d421\')}'})" autocomplete="off" />
                    </div>
                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
            </div>
            </form>
        </div>
        <div class="paging"></div>
    </div>
</section>
@section footerScript{
    <script type="text/javascript">
        var oldPassword = "@(ViewBag.Password)";

        $(function () {
            Topro.UI.DataAutoHeight();

            doSearch();

            $("#btnSearch").click(function () {
                doSearch();
            });

            window.setInterval(function () {
                doSearch();
            }, 10000);
        });

        function Tip_success(word) {
            Topro.UI.Tip_success(word);
        }

        function exportExcel(){
            var password = prompt("输入密码:","");
            if (password!=null && password!="" && password == oldPassword){
                $("#formSearch").submit();
            }
            else{
                Topro.UI.Tip_short_warning("输入密码有误.");
            }
        }

        function doSearch() {
            Topro.UI.Pager(".paging", { ajax: { url: '@Url.Action("DeviceDataQuery", "DeviceData")' } });
        }
    </script>
}


